#!/usr/bin/env node

const https = require('https');
const user = process.argv[2];
const addr =`https://gitee.com/api/v5/users/${user}/repos?access_token=efcb884d6f9cfc9d598c62caf600fd20&type=all&sort=full_name&page=1&per_page=20`;
https.get(addr,(res)=>{
  console.log(`HTTP/${res.httpVersion}
    ${res.statusCode}
    ${res.statusMessage}
    `);
  console.log(res.headers);
console.log();


let data = '';
res.on('data',(chunk)=>{
  data += chunk;
});
res.on('end',()=>{
  data = JSON.parse(data);
  for(const repos of data){
  console.log(repos.full_name);
  }
});
})
